solving system of linear equations with three variables